home *** CD-ROM | disk | FTP | other *** search
/ Zoom 2 / Zoom - Release 2 (1996)(Active Software)[!].iso / programming / amos / amossible / spritesnbobs / bobcol2.amos / bobcol2.amosSourceCode < prev    next >
Encoding:
AMOS Source Code  |  1980-05-17  |  1.0 KB  |  32 lines

  1. Rem In a similar manner to the first Bob collision example,you control 
  2. Rem a Bob on screen with the joystick,but this time,we have several  
  3. Rem Bobs on screen,and test for collisions between Bob 1 and bobs 2 to 4.  
  4. Rem This way allows us to test for a collision between one Bob and a range 
  5. Rem of others. 
  6. Rem In the line:If Bob Col(1,2 To 4)then etc...
  7. Rem the first number is the bob we want to check for collisions
  8. Rem with the others,in this case its Bob 1,the next number(2) is the 
  9. Rem start of the range of Bobs we are checking collisions with,so we 
  10. Rem obviously start with the lowest nuber,then we write "To" and then the
  11. Rem last nuber in the range of Bobs we are checking(In this case 4). 
  12. Screen Open 0,320,256,16,Lowres
  13. Flash Off 
  14. Curs Off 
  15. Cls 0
  16. Load "ATTBG:JUMP.Abk"
  17. Get Sprite Palette 
  18. Double Buffer 
  19. X=150
  20. Y=110
  21. Bob 2,20,50,3
  22. Bob 3,190,50,3
  23. Bob 4,190,200,3
  24. Bob 5,20,200,2
  25. Do 
  26. If Joy(1)=1 Then Y=Y-1
  27. If Joy(1)=2 Then Y=Y+1
  28. If Joy(1)=4 Then X=X-1
  29. If Joy(1)=8 Then X=X+1
  30. If Bob Col(1,2 To 4) Then Print At(10,10);"COLLISION DETECTED"
  31. Bob 1,X,Y,1
  32. Loop